import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import _createSuper from "@babel/runtime/helpers/esm/createSuper";

var _dec, _class;

import React, { PureComponent } from 'react';
import { Modal, Spin, Form, Button } from 'antd';
import intl from 'utils/intl';
var ErrorModal = (_dec = Form.create({
  fieldNameProp: null
}), _dec(_class = /*#__PURE__*/function (_PureComponent) {
  _inherits(ErrorModal, _PureComponent);

  var _super = _createSuper(ErrorModal);

  function ErrorModal() {
    _classCallCheck(this, ErrorModal);

    return _super.apply(this, arguments);
  }

  _createClass(ErrorModal, [{
    key: "render",
    value: function render() {
      var _this$props = this.props,
          onOk = _this$props.onOk,
          errorDetail = _this$props.errorDetail,
          errorVisible = _this$props.errorVisible,
          _this$props$errorDeta = _this$props.errorDetailLoading,
          errorDetailLoading = _this$props$errorDeta === void 0 ? false : _this$props$errorDeta;
      return /*#__PURE__*/React.createElement(Modal, {
        title: intl.get('csdr.jobLog.model.jobLog.errorDetail').d('错误详情'),
        visible: errorVisible,
        wrapClassName: "ant-modal-sidebar-right",
        transitionName: "move-right",
        width: 600,
        destroyOnClose: true,
        closable: false,
        footer: /*#__PURE__*/React.createElement(Button, {
          type: "primary",
          onClick: onOk
        }, intl.get('cpaas.common.button.ok').d('确定'))
      }, /*#__PURE__*/React.createElement(Spin, {
        spinning: errorDetailLoading
      }, /*#__PURE__*/React.createElement("pre", {
        dangerouslySetInnerHTML: {
          __html: errorDetail
        }
      })));
    }
  }]);

  return ErrorModal;
}(PureComponent)) || _class);
export { ErrorModal as default };